for row in range(1,10):
    for col in range(1,10):
        if col<=row:
            print('{}*{}={:<3}'.format(row,col,row*col),end=' ')
    print('')
print('')
print('='*80)
print('')
for row in range(9,0,-1):
    for col in range(1,row+1):
        print('{}*{}={:<3}'.format(row,col,row*col),end=' ')
    print('')
print('')
print('='*80)
print('')
for row in range(9,0,-1):
    for col in range(1,row):
        print('{:<8}'.format(''),end='')
    for col in range(10-row,0,-1):
        print('{}*{}={:<3}'.format(col,row,row*col),end=' ')
    print('')
print('')
print('='*80)
print('')
for row in range(9,0,-1):
    for col in range(9-row,0,-1):
        print('{:<8}'.format(''),end='')
    for col in range(row,0,-1):
        print('{}*{}={:<3}'.format(row,col,row*col),end=' ')
    print('')
print('')
print('='*80)
print('')
row1=1
while row1<10:
    col1=1
    while col1<10:
        if col1<=row1:
            print('{}*{}={:<3}'.format(row1, col1, row1 * col1), end=' ')
        col1+=1
    print('')
    row1+=1
print('')
print('='*80)
print('')
row1=9
while row1>0:
    col1=9
    while col1>0:
        if col1<=row1:
            print('{}*{}={:<3}'.format(row1, col1, row1 * col1), end=' ')
        col1-=1
    print('')
    row1-=1
print('')
print('='*80)
print('')
row1=1
while row1<10:
    col1=1
    while col1<10:
        if col1>=10-row1:
            print('{}*{}={:<3}'.format(row1, col1, row1 * col1), end=' ')
        else:
            print(' '*8,end='')
        col1+=1
    print('')
    row1+=1
print('')
print('='*80)
print('')
row1=9
while row1>0:
    col1=9
    while col1>0:
        if col1<=row1:
            print('{}*{}={:<3}'.format(row1, col1, row1 * col1), end=' ')
        else:
            print(' '*8,end='')
        col1-=1
    print('')
    row1-=1
